import { getMonthProduceData } from "@/api/dashboard/blowIrriagtionSpinLineMonthly";

export default {
  data() {
    return {
      monthProduceData: null,
    };
  },
  methods: {
    getData() {
      this.getMonthProcuceData();
    },
    // 获取月度生产数据
    async getMonthProcuceData() {
      try {
        const { factoryDeptCode, lineCode } = this.lineItem.properties;
        const params = {
          factoryDeptCode,
          lineCode,
        };
        const res = await getMonthProduceData(params);

        this.monthProduceData = res.data;
      } catch (error) {
        this.monthProduceData = null;
      }
    },
  },
  watch: {
    refreshKey: {
      handler() {
        this.getData();
      },
    },
  },
};
